package com.ChengXiZi.mapper;

import com.ChengXiZi.dto.UserCommunityAddDTO;
import com.ChengXiZi.entity.UserCommunity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserCommunityMapper {

    /**
     * 向用户关系表中添加记录
     * @param userCommunity
     */
    void insert(UserCommunity userCommunity);

    /**
     * 根据Dto查询记录
     * @param userCommunityAddDTO
     * @return
     */
    @Select("select * from user_community where user_id = #{userId} and community_id = #{communityId}")
    UserCommunity selectByDto(UserCommunityAddDTO userCommunityAddDTO);
}
